package de.cms.kff.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Josef Schneeberger (josef.schneeberger@fh-deggendorf.de)
 */
@Entity
@Table(name="tbl_verleih")
public class Verleih {
    @Id
    @GeneratedValue
	@Column(name="pk_verleih")
    private Integer id;
	private Date created;
    private Date von;
    private Date bis;
    private int kilometerstand;
    
	@OneToOne(fetch=FetchType.EAGER)
	  @JoinColumn(name="AUTO_FK")
	private Auto auto;
	
	@OneToOne(fetch=FetchType.EAGER)
	  @JoinColumn(name="MITARBEITER_FK")
	private Mitarbeiter mitarbeiter;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getVon() {
		return von;
	}

	public void setVon(Date von) {
		this.von = von;
	}

	public Date getBis() {
		return bis;
	}

	public void setBis(Date bis) {
		this.bis = bis;
	}

	public Auto getAuto() {
		return auto;
	}

	public void setAuto(Auto auto) {
		this.auto = auto;
	}

	public Mitarbeiter getMitarbeiter() {
		return mitarbeiter;
	}

	public void setMitarbeiter(Mitarbeiter mitarbeiter) {
		this.mitarbeiter = mitarbeiter;
	}

	public int getKilometerstand() {
		return kilometerstand;
	}

	public void setKilometerstand(int kilometerstand) {
		this.kilometerstand = kilometerstand;
	}
	
}
